{extend name="layout" /}
{block name="content"}
<div class="row">
  <div class="col-xs-8">
    <form id="searchForm">
      <div class="seardiv" style="width: 25%;float: left;">
        <select name="source" class="form-control input-sm">
          <option value="">请选择客户来源</option>
          {volist name=":config('CLIENT_SOURCE')" id="v" key="k"}
          <option value="{$k}">{$v}</option>
          {/volist}
        </select>
      </div>
      <div class="seardiv" style="width: 25%;float: left;">
        <select name="skilled" class="form-control input-sm">
          <option value="">请选择客户成熟度</option>
          {volist name=":config('CLIENT_SKILLED')" id="v" key="k"}
          <option value="{$k}">{$v}</option>
          {/volist}
        </select>
      </div>
      <div class="seardiv" style="width: 25%;float: left;">
        <select name="typeid" class="form-control input-sm">
          <option value="">请选择客户类型</option>
          {volist name=":config('CLIENT_TYPE')" id="v" key="k"}
          <option value="{$k}">{$v}</option>
          {/volist}
        </select>
      </div>
      <div class="input-group input-group-sm demoTable">
        <input type="text" class="form-control input-sm" name="keywords" id="demoReload" autocomplete="off" placeholder="请输入客户姓名">
        <span class="input-group-btn">
          <button type="button" class="btn btn-info btn-flat layui-btn" data-type="reload">搜  索</button>
        </span>
      </div>
    </form>
  </div>
  <div class="col-xs-4" style="text-align: right">
    <!-- <button type="button" class="btn btn-success btn-sm cocoModal" isForm url="{:url('add')}" title="新增项目" fixat="1"><i class="fa fa-plus"></i> 新增</button> -->
    <!-- <button type="button" class="btn btn-default btn-sm cocoAjax" confirm="确定要更新缓存吗？" ajaxUrl="{:url('data_cache',array('model'=>$model))}"><i class="fa fa-retweet"></i> 更新缓存</button> -->
    <!-- <button type="button" class="btn btn-danger btn-sm cocoAjax" confirm="确定要删除吗？" checkItem="1:0" ajaxUrl="{:url('data_delete')}"><i class="fa fa-remove"></i> 批量删除</button> -->
    <!-- <button type="button" class="btn btn-danger btn-sm btnAction" data-type="delAll" confirm="确定要删除吗？" checkItem="1:0" ajaxUrl="{:url('data_delete',array('model'=>$model))}"><i class="fa fa-remove"></i> 批量删除</button> -->
    <button type="button" class="btn btn-info btn-sm export" title="线索列表"><i class="fa fa-edit"></i> 数据导出</button>
  </div>
</div>
  
<table class="layui-table" lay-data="{height: 'full-75', cellMinWidth: 80, page: true, limit:30, id:'lists', url:'{:url('data_show_where')}'}" lay-filter="lists">
  <thead>
    <tr class="layui-colla-content">
      <th lay-data="{type:'checkbox'}">ID</th>
      <th lay-data="{field:'id', sort: true}">ID</th>
      <th lay-data="{field:'marketer'}">所有者</th>
      <th lay-data="{field:'dealer'}">所属经销商</th>
      <th lay-data="{field:'directorname'}">销售总监</th>
      <th lay-data="{field:'name'}">姓名</th>
      <th lay-data="{field:'product'}">意向产品</th>
      <!-- <th lay-data="{field:'city'}">所在城市</th> -->
      <th lay-data="{field:'phone'}">手机号</th>
      <!-- <th lay-data="{field:'qq'}">社交账号</th> -->
      <th lay-data="{field:'getdate'}">获取时间</th>
      <th lay-data="{field:'home'}">家庭住址</th>
      <th lay-data="{field:'sourcename'}">来源</th>
      <th lay-data="{field:'skilledname'}">成熟度</th>
      <th lay-data="{field:'statusname'}">状态</th>
      <th lay-data="{field:'remark'}">备注</th>
      <!-- <th lay-data="{field:'typename'}">客户类型</th> -->
      <th lay-data="{field:'adddate'}">添加时间</th>
      <th lay-data="{fixed: 'right', width:120, align:'center', toolbar: '#barDemo'}">操作</th>
  </thead>
</table>
<script type="text/html" id="barDemo">
  <!-- <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a> -->
  <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
{/block}
{block name="script"}
<script type="text/javascript">
  layui.use('table', function(){
    var table = layui.table;
    var $ = layui.$, active = {
      reload: function(){
        //执行重载
        table.reload('lists', {
          page: {
            curr: 1 //重新从第 1 页开始
          }
          ,where: $('#searchForm').serializeObject()
        });
      }
    };
    $('.demoTable .layui-btn').on('click', function(){
      var type = $(this).data('type');
      active[type] ? active[type].call(this) : '';
    });
  });
</script>
{/block}